﻿﻿﻿{extends file="layout.tpl"}
{block name="title"}##NA_HOME##{/block}
{block name="script"}
  $(document).ready(function () {
    $( ".dialog" ).dialog({
      autoOpen: false,
      modal:true,
      resizable: false,
      width:500,
        buttons: {
        "##LB_SUBMIT##": function() {
          var id = $(this).attr('applyID');
         window.location.href="apply.php?applyID="+id;
        },
        Cancel: function() {
          $( this ).dialog( "close" );
        }
      }
    });
    $('table#apply td input.apply').click(function()
    {
        
         var id = $(this).parent().parent().attr('id');
         $( "#dialog_"+id ).dialog("open");
    });
     });
{/block}
{block name="content"}
    <style>
		td img{
			vertical-align: middle;
			padding: 0px 10px 10px 0px;
		}
		td span {
			
			vertical-align: middle;
			font-size:16px;
		}
			
	</style>
        <div class="grid_12">
            <div class="box round first center" style="width:80%">
                <h2>##LB_PERSONAL_INFORMATION##</h2>
                <div class="block " style="vertical-align: middle">
                    <img src="img/profile.png" width="50px" style="float:left"></img><a style="float:left;margin:10px" href="profile/intro.php">##LB_SCIENTIFIC_PROFILE##</a>
                </div>
                <div class="clear"></div>
            </div>
		   <div class="box round first center" style="width:80%">
                <h2>##LB_RECRUITMENT_INFORMATION##</h2>
				<table class="data display datatable" name="apply" id="apply">
					<thead>
						<tr>
							<td bgcolor="#FFFFFF"><div align="center"><strong>
								 #
							</strong></div></td>
							<td bgcolor="#FFFFFF" style="width:55%;" align="center"><strong>
								##NG_CONTENT##
							</strong></td>
                                                        <td bgcolor="#FFFFFF"><strong>##NG_STATE##</strong></td>
							<td bgcolor="#FFFFFF" align="center"><strong>
								##NG_APPLY##
							</strong></td>
						</tr>
					</thead>
					<tbody>
						{foreach $items|default:array() as $i}
							<tr id="{$i.Ma}">
								<td align="center">
									{$i@index + 1}
								</td>
								<td>
									<span>{$i.NoiDung}<span>
                                                                                <div class="dialog" id="dialog_{$i.Ma}" title="##LB_ATTENTION##" applyID="{$i.Ma}">{$i.GhiChu}<br>
                                                                   
                                                                </div>
								</td>
                                                                <td>
                                                                     <span>
                                                                    {if !isset($i.TinhTrang)}
                                                                       ##NG_NOTAPPLY##
                                                                        {else}
                                                                            {if $i.TinhTrang==0}
                                                                                ##NG_WAIT_PROCESSING##                                                                                                                               {/if}
                                                                                {if $i.TinhTrang==1}
                                                                                    ##NG_ACCEPTED##
                                                                                {/if}
                                                                                  {if $i.TinhTrang==-1}
                                                                                    ##NG_FAILED##
                                                                                {/if}
                                                                                {/if}
                                                                        </span>
                                                                </td>
								<td>
									<img src="img/apply.png"/><input type="button" value="##NG_APPLY##" name="apply_{$i.Ma}" class="btn btn-blue apply"/>
								</td>
                                                                
							</tr>
						{/foreach}
					</tbody>
				</table>
            </div>
                    <div class="clear">
        </div>
        </div>
		<div class="clear">
        </div>
                                                
{/block}
	
